<?xml version="1.0" encoding="UTF-8"?>
<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<rich:panel id="menu_horizontal" styleClass="rf-tb">
		<h:form>
			<rich:toolbar itemSeparator="line">
				<rich:toolbarGroup>
				</rich:toolbarGroup>
				
				<rich:toolbarGroup itemSeparator="grid" rendered="#{rich:isUserInRole('Gerente') or rich:isUserInRole('Executor')}">
					Projeto
					<h:selectOneMenu id="selProjetos" value="#{menuControl.idProjetoSelecionado}" onchange="submit()" valueChangeListener="#{menuControl.selecionarProjeto}">
						<f:selectItems value="#{menuControl.projetos}" var="p" itemValue="#{p.id}" itemLabel="#{p.nome}" />
					</h:selectOneMenu>
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Gerente') and menuControl.exibirOpcoesGerente}" >
					<h:commandLink action="#{manterProjetosControl.iniciar}" value="Meus Projetos" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{menuControl.exibirPlanejarFases}">
					<h:commandLink action="#{planejarFasesControl.iniciar}" value="Plano de Fases" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{menuControl.exibirPlanejarIteracao}">
					<h:commandLink action="#{planejarIteracaoControl.planejarProximaIteracao}" value="Plano da Iteração" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Gerente') and menuControl.exibirOpcoesGerente}">
					<h:commandLink action="#{acompanharProjetoControl.iniciar}" value="Acompanhamento" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Gerente') and menuControl.exibirOpcoesGerente}">
					<h:commandLink action="#{manterRequisitosControl.iniciar}" value="Requisitos" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Gerente') and menuControl.exibirOpcoesGerente}">
					<h:commandLink action="#{manterCasosUsoControl.listarCasoUso}" value="Casos de Uso" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Gerente') and menuControl.exibirOpcoesGerente}">
					<h:commandLink action="#{manterRiscoControl.pesquisarRisco}" value="Riscos" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Gerente') and menuControl.exibirOpcoesGerente}">
					<h:commandLink action="#{manterRecursosProjetoControl.iniciar}" value="Recursos" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Gerente') or rich:isUserInRole('Executor')}">
					<h:commandLink action="#{registrarExecucaoControl.iniciar}" value="Registrar Execução" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				
				
				<!-- Menu do admin -->
				<rich:toolbarGroup rendered="#{rich:isUserInRole('Administrador')}">
					<h:commandLink action="#{manterRecursoControl.iniciarListarRecurso}" value="Recursos" styleClass="link-menu" />
				</rich:toolbarGroup>
				
				<rich:toolbarGroup location="right">
					<h:commandLink action="#{menuControl.sair}" styleClass="link-menu">
						<h:graphicImage library="images" name="door_out.png" title="Remover Fase" />
						<h:outputText value=" Sair" />
					</h:commandLink>
				</rich:toolbarGroup>
			</rich:toolbar>
			
		</h:form>
	</rich:panel>
</ui:component>